<?php

namespace JsonLowCode\UI;

use JsonLowCode\Schema;

/**
 * Svg图标组件
 * @method static SvgIcon make(string $name = null) SvgIcon组件
 */
class SvgIcon extends Schema
{
    protected string $componentName = "SvgIcon";

    /**
     * @param mixed|null $name
     */
    public function __construct(string $name = null)
    {
        parent::__construct();
        $name && $this->icon($name);
    }

    /**
     * 设置图标名称
     * @param string $name
     * @return $this
     */
    public function icon(string $name): static
    {
        return $this->prop("icon", $name);
    }

    /**
     * 设置本地图标名称
     * @param string $name
     * @return $this
     */
    public function localIcon(string $name): static
    {
        return $this->prop("local-icon", $name);
    }


}
